<%@ page pageEncoding="UTF-8"%>
<c:import url="../../../template/layout.jsp" charEncoding="UTF-8">
  <c:param name="title" value="新建用户" />
  <c:param name="body">
    <script>
      $(document).ready(
              function() {
                var id = $(".id").val();
                if(id){

                }

              });
    </script>


    <div class="content-title">新建用户</div>

    <form name="user" class="form-horizontal"  action="${pageContext.request.contextPath}/system/user/edit" method="post">
      <div align="left" style="width: 600px; margin-right: auto; margin-left: auto;">
        <div class="form-group">
          <label for="username" class="col-sm-2 control-label"><span style="color:red;">*</span>用户账户</label>
          <div class="col-sm-10">
            <input type="text" class="form-control" name="username" required>
          </div>
        </div>
        <div class="form-group">
          <label for="password" class="col-sm-2 control-label"><span style="color:red;">*</span>默认密码</label>
          <div class="col-sm-10">
            <input type="password" class="form-control" name="password" value="123456" readonly>
          </div>
        </div>
        <div class="form-group">
          <label for="mobile" class="col-sm-2 control-label"><span style="color:red;">*</span>手机</label>
          <div class="col-sm-10">
            <input type="number" class="form-control readOnly" name="mobile" required>
          </div>
        </div>
        <div class="form-group">
          <label for="email" class="col-sm-2 control-label"><span style="color:red;">*</span>邮箱</label>
          <div class="col-sm-10">
            <input type="email" class="form-control" name="email" required>
          </div>
        </div>

        <div class="form-group">
          <label for="realName" class="col-sm-2 control-label"><span style="color:red;">*</span>真实姓名</label>
          <div class="col-sm-10">
            <input type="text" class="form-control" name="realName" required>
          </div>
        </div>
        <div class="form-group">
          <label for="role" class="col-sm-2 control-label"><span style="color:red;">*</span>为用户分配角色</label>
          <div class="col-sm-10">
            <c:if test="${roles != null}">
              <c:forEach items="${roles}" var="role">
                <label><input type="checkbox" name="role" value="${role.id}">${role.rolename}</label>
              </c:forEach>
            </c:if>
          </div>
        </div>

        <div class="form-group">
          <div class="col-sm-offset-2 col-sm-10">
            <input type="submit" value="提交" class="btn btn-primary" /> <input type="reset" value="重置"
                                                                              class="btn btn-default" />
          </div>
        </div>
      </div>
    </form>
  </c:param>
</c:import>
